{% extends "base_user.html" %}
{% block feeds %}<link rel="alternate" href="/feeds/author/{{ object.username }}/" type="application/atom+xml" title="Feed of snippets by {{ object.username }}" />{% endblock %}
{% block title %}Snippets by {{ object.username }}{% endblock %}

{% block content_header %}Snippets by {{ object.username }}{% endblock %}

{% block main_content %}
{% if object_list %}
<ul>
{% for snippet in object_list %}
<li><a href="{{ snippet.get_absolute_url }}">{{ snippet.title }}</a> (<a href="{{ snippet.language.get_absolute_url }}">{{ snippet.language.name }}</a>) {{ snippet.pub_date|timesince }} ago</li>
{% endfor %}
</ul>

<p class="pagination">{% if has_previous %}<a href="?page={{ previous }}">&lt; Previous {{ results_per_page }}</a>{% endif %}&nbsp;&nbsp;{% if has_next %}<a href="?page={{ next }}">Next {{ results_per_page }} &gt;</a>{% endif %}</p>
{% else %}
<p>{% ifequal user.username object.username %}You haven't{% else %}{{ object.username }} hasn't{% endifequal %} posted any snippets yet.</p>
{% endif %}
{% endblock %}

{% block sidebar %}
<p>{% ifequal user.username object.username %}You've{% else %}{{ object.username }} has{% endifequal %} posted {{ hits }} snippet{{ object_list.count|pluralize }}.</p>

<p><a rel="alternate" href="/feeds/author/{{ object.username }}/" type="application/atom+xml"><img src="http://media.djangosnippets.org/img/feed-icon-10x10.png" alt="" /> Feed of snippets by {{ object.username }}</a></p>

<p>The users who've submitted the most snippets are:</p>
{% load popular %}
{% get_top_authors 5 as top_authors %}
<ol>
{% for author in top_authors %}
<li><a href="/users/{{ author.username }}/">{{ author.username }}</a></li>
{% endfor %}
</ol>

{% endblock %}